<?php
class Digitalus_View_Helper_Date
{
    public $dateTemplates = array(
        'short'	    => 'n/j/y',
        'med'		=> 'M j, Y',
        'long'		=> 'F j, Y'
    );
    
    public $timeTemplates = array(
        '12 hour'	=> 'g:i A',
        '24 hour'	=> 'G:i'
    );    
    
    public function date($timestamp, $format = 'short', $timeFormat = null)
    {
        if(intval($timestamp) > 0) {
            $date = date($this->dateTemplates[$format], $timestamp);
            if($timeFormat != null) {
                $date .= ' ' . date($this->timeTemplates[$timeFormat], $timestamp);
            }
            return $date;
        }else{
            return null;
        }
    }
}
?>